package com.wkbb.common.enums;

/**
 * @author yangdaofang
 * 创建时间：2020-04-30 17:16
 */
public enum SmartUserTypeEnum {
    //用户角色
    SMART_USER_TYPE_STUDENT(1, "学生"),
    SMART_USER_TYPE_TEACHER(2, "老师"),
    SMART_USER_TYPE_FAMILY(3, "家长");

    private Integer code;
    private String desc;

    SmartUserTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 普通方法
    public static String getDesc(short code) {
        for (SmartUserTypeEnum smartUserTypeEnum : SmartUserTypeEnum.values()) {
            if (smartUserTypeEnum.getCode() == code) {
                return smartUserTypeEnum.desc;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
